<template>
	<view class="user-outer-wrapper">
		<!-- 用户信息 -->
		<view class="my-wrapper" :style="{backgroundImage: 'url('+pictureDomain+'my-bg-png.png);'}">
			<view class="userinfo-none" v-if="isAuthInfo">
				<view class="default-pic" @tap="toPersonalInformation">
					<image :src="userInfo.pic? userInfo.pic : '/static/images/icon/head04.png'"></image>
				</view>
				<view class="none-login">
					<view class="member-lev">
						<text class="nick-name" @tap="toPersonalInformation">{{userInfo.nickName}}</text>
						<view class="level">
							<image class="l-bg"
								:src="userLevelInfo.levelType==1?'/static/images/icon/integral-icon.png':'/static/images/icon/normal-icon.png'"
								role="img"></image>
							<view class="text">{{userLevelInfo.levelName}}</view>
						</view>
					</view>

					<view class="member-integral" @tap="toMemberInteral">
						<image src="/static/images/icon/jifen.png"></image>
						<text>{{i18n.integral}}：{{userLevelInfo.score?userLevelInfo.score:'0'}}</text>
						<text class="arrow" style="color: #fff;"></text>
					</view>
					<!-- <text class="update-info" bindtap="updateInfo">更新信息</text> -->
					<view class="buy-member" @tap="toBuyMember">
						<image src="/static/images/icon/goumaihuiyuan@2x.png"></image>
						<text>{{i18n.buyMembership}}</text>
					</view>
				</view>
			</view>

			<view class="userinfo-none" v-if="!isAuthInfo" @tap="onGotUserInfo">
				<view class="default-pic">
					<image src="/static/images/icon/head04.png"></image>
				</view>
				<view class="none-login">
					<button class="click-login">{{i18n.clickAccountLogin}}</button>
				</view>
			</view>
			<!-- end 用户信息 -->
		</view>

		<!-- 钱包数据 -->
		<view class="wallet-data" v-if="isAuthInfo">
			<view class="data-item" @tap="toMyWallet">
				<view class="data-num">{{i18n.currencySymbol + totalBalance}}</view>
				<view class="data-name">{{i18n.balance}}</view>
			</view>
			<view class="data-item" @tap="toMyCouponPage">
				<view class="data-num">{{couponNum}}</view>
				<view class="data-name">{{i18n.coupon}}</view>
			</view>
			<view class="data-item" @tap="toMemberInteral">
				<view class="data-num">{{score}}</view>
				<view class="data-name">{{i18n.userIntegral}}</view>
			</view>
			<view class="data-item" @tap="toMyMessage">
				<!-- #ifndef MP-WEIXIN -->
				<!-- 除了小程序，其它平台均存在的代码 -->
				<view class="data-num">{{messageCount}}<sup class="dot" v-if="messageCount > 0">●</sup></view>
				<!-- #endif -->
				<!-- #ifdef MP-WEIXIN -->
				<!-- 只在微信小程序平台存在的代码 -->
				<view class="data-num">{{messageCount}}
					<view class="point" v-if="messageCount > 0">●</view>
				</view>
				<!-- #endif -->
				<view class="data-name">{{i18n.messageNotify}}</view>
			</view>
		</view>
		<!-- 钱包数据 end -->

		<view class="list-cont">

			<!-- 订单状态 -->
			<view class="total-order">
				<view class="order-tit">
					<text style="font-weight:bold">{{i18n.myOrder}}</text>
					<view class="checkmore" @tap="toOrderListPage" data-sts="0">
						<text>{{i18n.viewAll}}</text>
						<text class="arrowhead"></text>
					</view>
				</view>
				<view class="procedure">
					<view class="items" @tap="toOrderListPage" data-sts="1">
						<image src="/static/images/icon/toPay.png"></image>
						<text>{{i18n.toBePaid}}</text>
						<text class="num-badge" v-if="orderAmount.unPay>0">{{orderAmount.unPay}}</text>
					</view>
					<view class="items" @tap="toOrderListPage" data-sts="2">
						<image src="/static/images/icon/toDelivery.png"></image>
						<text>{{i18n.toBeDelivered}}</text>
						<text class="num-badge" v-if="orderAmount.payed>0">{{orderAmount.payed}}</text>
					</view>
					<view class="items" @tap="toOrderListPage" data-sts="3">
						<image src="/static/images/icon/toTake.png"></image>
						<text>{{i18n.toBeReceived}}</text>
						<text class="num-badge" v-if="orderAmount.consignment>0">{{orderAmount.consignment}}</text>
					</view>
					<view class="items" @tap="toOrderListPage" data-sts="5">
						<image src="/static/images/icon/toComment.png"></image>
						<text>{{i18n.completed}}</text>
					</view>
					<view class="items" @tap="toAfterSalesPage">
						<image src="/static/images/icon/refund.png"></image>
						<text>{{i18n.refundAfterSale}}</text>
						<text class="num-badge after-sale-num-badge"
							v-if="orderAmount.refund>0">{{orderAmount.refund}}</text>
					</view>
				</view>
			</view>

			<view class="my-menu">
				<!--  wx:if="{{canDistribution}}" -->
				<view class="memu-item" @tap="sacnCode">
					<view class="i-name">
						<image src="/static/images/icon/myCoupon.png"></image>
						<text>{{i18n.scanCodePickup}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<view class="memu-item" @tap="toCouponCenter">
					<view class="i-name">
						<image src="/static/images/icon/getCoupon.png"></image>
						<text>{{i18n.couponCenter}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<view class="memu-item" @tap="toPointsCenter">
					<view class="i-name">
						<image src="/static/images/icon/myInt.png"></image>
						<text>{{i18n.membershipCentre}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<view class="memu-item" @tap="toAddressList">
					<view class="i-name">
						<image src="/static/images/icon/myAddr.png"></image>
						<text>{{i18n.shippingAddress}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<view class="memu-item" @tap="myCollectionHandle">
					<view class="i-name">
						<image src="/static/images/icon/myCol.png"></image>


						<text>{{i18n.myCollection}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<view class="memu-item" @tap="setPassword">
					<view class="i-name">
						<image src="/static/images/icon/set-password.png"></image>
						<text>{{i18n.changePassword}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<!-- #ifndef MP -->
				<view class="memu-item" @tap="applyAShop"
					v-if="shopAuditStatus != 1 &&shopStatus != 1 && shopStatus != 2">
					<view class="i-name">
						<image src="/static/images/icon/myshop.png"></image>
						<text>{{i18n.freeShop}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<!-- shopAuditStatus审核状态：0 未审核 1已通过 -1未通过 null 未开店 -->
				<view class="memu-item" @tap="settingAccout"
					v-if="(shopAuditStatus == 1 && isSetPassword == false) && shopStatus == 1 ">
					<view class="i-name">
						<image src="/static/images/icon/account-settings.png"></image>
						<text>{{i18n.storeAccountSettings}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<view class="memu-item" @tap="alterPassword" v-if="shopAuditStatus == 1 && isSetPassword == true">
					<view class="i-name">
						<image src="/static/images/icon/account-settings.png"></image>
						<text>{{i18n.modifyShopPassword}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<view class="memu-item" @tap="enterMyShop" v-if="shopStatus == 1 || shopStatus == 2"
					:data-shopid="shopId">
					<view class="i-name">
						<image src="/static/images/icon/myshop.png"></image>
						<text>{{i18n.myShop}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
				<!-- #endif -->
				<button class="memu-btn memu-item" @tap="gotoChat">
					<view class="i-name">
						<image src="/static/images/icon/customer-service.png"></image>
						<text>{{i18n.contactCustomerService}}</text>
					</view>
					<view class="arrowhead"></view>
				</button>
				<view class="memu-item" @tap="gotoMessageBox">
					<view class="i-name">
						<image src="/static/images/icon/messageBox.png"></image>
						<text>{{i18n.messageBox}}</text>
					</view>
					<view class="arrowhead"></view>
				</view>
			</view>
			<!--end 列表项 -->
			<view class="log-out" @tap="logout()" v-if="isAuthInfo">
				<view class="log-out-n">
					<text>{{i18n.signOut}}</text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	var config = require("../../utils/config.js");
	var http = require("../../utils/http.js");
	var util = require("../../utils/util.js");
	import Wechat from '../../utils/wechat.js'
	import {
		PayType,
		AppType
	} from "../../utils/constant.js";

	export default {
		data() {
			return {
				pictureDomain: config.pictureDomain,
				shopId: 0,
				orderAmount: {},
				sts: '',
				collectionCount: 0,
				//分销开关
				canDistribution: true,
				isAuthInfo: true,
				shopAuditStatus: null, //店铺状态：0 未审核 1已通过 -1未通过 null 未开店
				isSetPassword: false,
				//是否已经设置过支付密码
				loginResult: {},
				userLevelInfo: {},
				shopStatus: '', // 店铺状态

				userInfo: {}, // 用户信息
				messageCount: 0, // 消息数量

				couponNum: 0, //优惠券数量
				score: 0, //用户积分
				totalBalance: 0, //用户余额
				notifyNum: 0,
			};
		},
		computed: {
			i18n() {
				return this.$t('index')
			}
		},

		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			uni.setNavigationBarTitle({
				title: this.i18n.personalCenter
			});
			http.getCartCount()
			// #ifndef H5
			var logData = uni.getStorageSync('flowAnalysisLogDto')
			uni.setStorageSync('step', uni.getStorageSync('step') / 1 + 1)
			if (logData && logData.pageId != 12) {
				logData.pageId = 12
				logData.step = uni.getStorageSync('step')
				uni.setStorageSync('flowAnalysisLogDto', logData)
				http.saveLog(logData, 1)
			}
			// #endif
			this.setData({
				isAuthInfo: Boolean(uni.getStorageSync('loginResult').userId),
				loginResult: uni.getStorageSync('loginResult')
			});
			// 排除 tempToken 影响，真实登陆后再请求数据
			if (uni.getStorageSync('token')) {
				//加载订单数据
				this.loadOrderCountFun();
				// 获取会员信息
				this.getUserLevelInfo();
				// 查询分销是否开启
				this.getDistInfo()
				// 查询用户信息
				this.queryUserInfo()
				// 获取用户消息
				this.getMyNotifyRemind()
				//钱包数据
				this.queryUserData()
			}
		},

		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {},
		methods: {
			/**
			 * 获取未读消息数量
			 */
			getMyNotifyRemind() {
				var params = {
					url: '/p/myNotifyLog/unReadCount',
					method: 'GET',
					dontTrunLogin: true,
					data: {},
					callBack: res => {
						if (uni.getStorageSync('token')) {
							this.setData({
								messageCount: res
							});
						}
					}
				};
				http.request(params)
			},
			/**
			 * 跳转站内消息
			 */
			toMyMessage() {
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageUser/pages/recent-news/recent-news?showMessage=1'
					})
				})
			},
			/**
			 * 切换语言
			 */
			changeLangs() {
				if (uni.getStorageSync("lang").indexOf('zh') != -1) {
					this._i18n.locale = 'en';
					uni.setStorageSync('lang', 'en')
				} else {
					this._i18n.locale = 'zh_CN';
					uni.setStorageSync('lang', 'zh_CN')
				}
				uni.reLaunch({
					url: '/pages/user/user',
					success: function(e) {
						var page = getCurrentPages().pop(); //跳转页面成功之后
						if (!page) return;
						console.log(page)
						page.onLoad(); //如果页面存在，则重新刷新页面
					}
				})
			},
			/**
			 * 钱包数据
			 */
			queryUserData: function() {
				var params = {
					url: "/p/user/getUserInfo",
					method: "GET",
					dontTrunLogin: true,
					data: {},
					callBack: res => {
						if (uni.getStorageSync('token')) {
							this.setData({
								couponNum: res.couponNum, //优惠券数量
								score: res.score, //用户积分
								totalBalance: res.totalBalance, //用户余额
								notifyNum: res.notifyNum, // 消息提醒
							});
						}
					}
				};
				http.request(params);
			},

			// 加载订单数据
			loadOrderCountFun() {
				uni.showLoading();
				var params = {
					url: "/p/user/centerInfo",
					method: "GET",
					dontTrunLogin: true,
					data: {},
					callBack: res => {
						uni.hideLoading();
						if (uni.getStorageSync('token')) {
							this.setData({
								// 店铺审核状态shopAuditStatus：-1未通过 0 未审核 1已通过 null未开店
								shopAuditStatus: res.shopAuditStatus,
								isSetPassword: res.isSetPassword,
								orderAmount: res.orderCountData,
								shopId: res.shopId,
								// 店铺状态shopStatus：-1未开通 0停业中 1营业中 2平台下线 3平台下线待审核
								shopStatus: res.shopStatus
							});
						}
						wx.setStorageSync("shopInfo", res)
					}
				};
				http.request(params);
			},

			// 我的钱包
			toMyWallet() {
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageUser/pages/myWallet/myWallet'
					})
				})
			},

			/**
			 * 扫一扫
			 */
			sacnCode: util.throttle(function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					// #ifdef H5
					if (!Wechat.isWechat()) {
						uni.showToast({
							title: this.i18n.openInWeChatBrowser,
							icon: "none"
						})
						return
					}
					Wechat.scanQRCode((codeStr) => {
						var code = ''
						// 处理扫码结果
						if (codeStr.indexOf(',') > -1) {
							code = codeStr.split(',')[1]
						} else {
							code = codeStr
						}
						uni.navigateTo({
							url: '/packageUser/pages/stationOrderList/stationOrderList?stationId=' +
								code
						})
					}, () => {
						uni.showToast({
							title: this.i18n.failedInvokeScan,
							icon: 'none'
						})
					})
					// #endif

					// #ifdef APP-PLUS || MP-WEIXIN
					uni.scanCode({
						success: (e) => {
							uni.navigateTo({
								url: '/packageUser/pages/stationOrderList/stationOrderList?stationId=' +
									e.result
							})
						},
						fail: (err) => {
							console.log(err)
						}
					})
					// #endif
				})

			}, 1000),


			/**
			 * 获取用户信息
			 */
			queryUserInfo: function() {
				wx.showLoading();
				var params = {
					url: "/p/user/userInfo",
					method: "GET",
					data: {},
					dontTrunLogin: true,
					callBack: (res) => {
						wx.hideLoading();
						this.userInfo = res
					}
				};
				http.request(params);
			},


			/**
			 * 查询分销相关信息
			 */
			getDistInfo() {
				//查询分销开关是否开启
				http.request({
					url: "/p/distribution/distributionBasicSet/canDistribution",
					method: "GET",
					// data: {
					//   shopId: 1,
					// },
					dontTrunLogin: true,
					callBack: res => {
						this.setData({
							canDistribution: res == 1
						});
					}
				});
			},

			/**
			 * 跳转分销员中心
			 */
			toDistCenter: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					http.request({
						url: "/p/distribution/user/distributionUserInfo",
						method: "GET",
						callBack: res => {
							console.log(res);

							if (res && res.state == 1) {
								// wx.setStorageSync("isDister", true);
								wx.setStorageSync("distCardNo", res.cardNo);
								wx.setStorageSync('distInfo', res);
								uni.navigateTo({
									url: '/packageDistribution/pages/dis-center/dis-center'
								});
							} else if (res && res.state == 0) {
								uni.showToast({
									title: this.i18n.applicationReview,
									icon: "none"
								});
							} else if (res && res.state == 3) {
								uni.showModal({
									title: '',
									content: this.i18n.applicationFailed,
									cancelText: this.i18n.cancel,
									confirmText: this.i18n.confirm,
									confirmColor: "#eb2444",

									success(res2) {
										if (res2.confirm) {
											if (res.recruitState) {
												uni.navigateTo({
													url: '/packageDistribution/pages/applyDist/applyDist'
												});
											} else {
												uni.navigateTo({
													url: '/packageDistribution/pages/applyDistCon/applyDistCon'
												});
											}
										} else if (res2.cancel) {
											console.log('用户点击取消');
										}
									}

								});
							} else if (res && res.state == -1) {
								uni.showModal({
									title: '',
									content: this.i18n.distributorBanned,
									confirmColor: "#eb2444",
									cancelText: this.i18n.cancel,
									confirmText: this.i18n.confirm,

									success(res2) {
										if (res2.confirm) {
											console.log('用户点击确认');
										} else if (res2.cancel) {
											console.log('用户点击取消');
										}
									}

								});
							} else if (res && res.state == 2) {
								uni.showModal({
									title: '',
									content: this.i18n.distributorCleared,
									confirmColor: "#eb2444",
									cancelText: this.i18n.cancel,
									confirmText: this.i18n.confirm,

									success(res2) {
										if (res2.confirm) {
											if (res.recruitState) {
												uni.navigateTo({
													url: '/packageDistribution/pages/applyDist/applyDist'
												});
											} else {
												uni.navigateTo({
													url: '/packageDistribution/pages/applyDistCon/applyDistCon'
												});
											}
										} else if (res2.cancel) {

										}
									}

								});
							} else if (res.recruitState == 0) {
								wx.showToast({
									title: this.i18n.distributionPromotionHasBeenClosed,
									icon: "none"
								});
								return
							} else {
								if (res.recruitState) {
									uni.navigateTo({
										url: '/packageDistribution/pages/applyDist/applyDist'
									});
								} else {
									uni.navigateTo({
										url: '/packageDistribution/pages/applyDistCon/applyDistCon'
									});
								}
							}
						}
					});
				})
			},
			toAfterSalesPage: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/pages/afterSales/afterSales'
					});
				})
			},
			//积分中心
			toPointsCenter: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageMemberIntegral/pages/memberIndex/memberIndex'
					});
				})
			},
			toCouponCenter: function() {
				util.tapLog(3)
				uni.navigateTo({
					url: '/packageActivities/pages/couponCenter/couponCenter'
				})
			},
			toMyCouponPage: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageActivities/pages/myCoupon/myCoupon'
					})
				})
			},
			toAddressList: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageUser/pages/delivery-address/delivery-address'
					})
				})
			},
			toOrderListPage: function(e) {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					var sts = e.currentTarget.dataset.sts;
					this.$Router.push({
						path: '/packageUser/pages/orderList/orderList',
						query: {
							sts: sts
						}
					})
				})
			},

			/**
			 * 查询所有的收藏量
			 */
			showCollectionCount: function() {
				var ths = this;
				uni.showLoading();
				var params = {
					url: "/p/user/collection/count",
					method: "GET",
					data: {},
					callBack: function(res) {
						uni.hideLoading();
						ths.setData({
							collectionCount: res
						});
					}
				};
				http.request(params);
			},

			/**
			 * 我的收藏跳转
			 */
			myCollectionHandle: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					var url = '/pages/prod-classify/prod-classify?sts=5'
					var id = 0
					var title = this.i18n.myCollection
					if (id) {
						url += "&tagid=" + id + "&title=" + title
					}
					uni.navigateTo({
						url: url
					})
				})
			},


			/**
			 * 跳转修改密码
			 */
			setPassword: function() {
				util.tapLog(3)
				uni.navigateTo({
					url: '/packageLogin/pages/accountLogin/accountLogin?isForgetPassword=true' + '&isPersonalCenter=true'
				});
			},

			/**
			 * 跳转到修改用户头像昵称资料
			 */
			toPersonalInformation: function() {
				util.tapLog(3)
				uni.navigateTo({
					url: '/packageUser/pages/personalInformation/personalInformation'
				})
			},


			/**
			 * 获取用户信息
			 */
			onGotUserInfo: function(e) {
				util.tapLog(3)
				util.checkAuthInfo()
			},

			/**
			 * 跳转到申请开店
			 */
			applyAShop: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					if (this.shopAuditStatus == 0) {
						uni.showToast({
							title: this.i18n.shopOpeningReview,
							icon: "none"
						});
					} else {
						uni.navigateTo({
							url: '/packageShop/pages/openAShop/openAShop?shopAuditStatus=' + this
								.shopAuditStatus
						})
					}
				})

			},

			/**
			 * 跳转到账号设置
			 */
			settingAccout: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageLogin/pages/accountSettings/accountSettings'
					});
				})
			},
			//跳转修改店铺密码
			alterPassword: function() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/pages/alterShopPassword/alterShopPassword'
					})
				})
			},

			/**
			 * 跳转到我的店铺
			 */
			enterMyShop: function(e) {
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageShop/pages/shopPage/shopPage?shopId=' + e.currentTarget.dataset
							.shopid
					})
				})
			},
			/**
			 * 跳转到和客服聊天的界面
			 */
			gotoChat() {
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageUser/pages/chat/chatIm?shopid=0'
					})
				})
			},
			/**
			 * 跳转到和商家客服聊天的界面
			 */
			gotoMessageBox() {
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageUser/pages/chat/chat'
					})
				})
			},
			/**
			 * 更新用户信息
			 */
			updateInfo() {
				util.tapLog(3)
				http.updateUserInfo();
			},

			/**
			 * 获取会员积分详情
			 */
			getUserLevelInfo() {
				var params = {
					url: '/p/score/scoreInfo',
					method: 'GET',
					dontTrunLogin: true,
					data: {},
					callBack: res => {
						this.setData({
							userLevelInfo: res
						});
					}
				};
				http.request(params);
			},

			/**
			 * 跳转购买会员
			 */
			toBuyMember() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageMemberIntegral/pages/buyVip/buyVip'
					});
				});
			},

			/**
			 * 跳转积分中心
			 */
			toMemberInteral() {
				util.tapLog(3)
				util.checkAuthInfo(() => {
					uni.navigateTo({
						url: '/packageMemberIntegral/pages/integralIndex/integralIndex'
					});
				});
			},

			/**
			 * 退出登录
			 */
			logout: function() {
				util.tapLog(3)
				// 请求退出登陆接口
				http.request({
					url: '/p/logout',
					method: 'GET',
				})
				uni.removeStorageSync('loginResult');
				uni.removeStorageSync('token');
				uni.removeStorageSync('tempToken');
				uni.removeStorageSync('recentSearch');
				uni.removeStorageSync('hadBindUser');
				uni.removeStorageSync('code');
				util.removeTabBadge()
				// 重置uuid、uuidSession、sessionTimeStamp、step、flowAnalysisLogDto
				uni.setStorageSync('uuid', util.getUuid())
				uni.setStorageSync('uuidSession', util.getUuid())
				uni.setStorageSync('sessionTimeStamp', new Date().getTime())
				uni.setStorageSync('step', 0)
				uni.setStorageSync('flowAnalysisLogDto', '')
				let emptyObj = {}
				this.setData({
					orderAmount: emptyObj,
					couponNum: 0, //优惠券数量
					score: 0, //用户积分
					totalBalance: 0, //用户余额
					notifyNum: 0, // 消息提醒
					messageCount: 0,
				})
				this.$Router.pushTab('/pages/index/index')
			}
		}
	};
</script>
<style lang="scss">
	page {
		background-color: #f7f7f7;
	}

	.user-outer-wrapper {

		.my-wrapper {
			height: 300rpx;
			background-size: cover;

			/** 未登录信息 */
			.userinfo-none {
				display: flex;
				padding: 50rpx 20rpx;
				align-items: center;
				position: relative;

				.default-pic {
					padding-right: 30rpx;

					image {
						width: 140rpx;
						height: 140rpx;
						border-radius: 50%;
					}
				}

				.none-login {
					button {
						background: #fff;

						&::after {
							border: 0;
						}
					}

					.unlogin {
						font-size: 30rpx;
					}

					.click-login {
						font-size: 26rpx;
					}
				}

				.member-lev {
					display: flex;
					align-items: center;
					justify-content: flex-start;
					margin-bottom: 20rpx;


					.nick-name {
						width: 150rpx;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						font-size: 32rpx;
						font-weight: 600;
						color: #fff;
					}

					.level {
						display: flex;
						align-items: center;
						justify-content: space-between;
						padding: 10rpx 14rpx;
						margin-left: 16rpx;
						box-sizing: border-box;
						background: #ff8282;
						border-radius: 32rpx;

						.l-bg {
							width: 28rpx;
							height: 28rpx;
						}

						.text {
							color: #a41919;
							font-size: 24rpx;
							font-family: arial;
							line-height: 1em;
							margin-left: 8rpx;
						}
					}
				}

				.arrow {
					width: 11rpx;
					height: 11rpx;
					border-top: 3rpx solid #686868;
					border-right: 3rpx solid #686868;
					transform: rotate(45deg);
					position: absolute;
					right: -26rpx;
					top: 12rpx;
				}

				.member-integral {
					display: flex;
					justify-content: baseline;
					align-content: center;
					font-size: 26rpx;
					position: relative;
					width: 90%;
					color: #fff;

					.arrow {
						position: relative;
						border-top: 1px solid #fff;
						border-right: 1px solid #fff;
					}

					image {
						width: 40rpx;
						height: 40rpx;
						margin-right: 10rpx;
					}
				}

				.buy-member {
					display: flex;
					position: absolute;
					align-content: center;
					right: 0;
					top: 50%;
					transform: translateY(-50%);
					background-color: #e43130;
					color: #fff;
					font-size: 24rpx;
					line-height: 40rpx;
					padding: 20rpx 26rpx;
					border-radius: 40rpx 0 0 40rpx;
					box-shadow: 1rpx 1rpx 6rpx rgb(233, 115, 115);

					image {
						width: 40rpx;
						height: 40rpx;
						display: block;
						margin-right: 10rpx;
					}
				}
			}
		}

		/* 订单状态 */


		/* 钱包数据 */
		.wallet-data {
			background: #fff;
			width: 700rpx;
			margin-left: 25rpx;
			padding: 30rpx 8rpx;
			margin-top: -50rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-radius: 8rpx;


			.data-item {
				position: relative;
				width: 25%;
				font-size: 26rpx;

				.data-num {
					font-size: 28rpx;
					margin-bottom: 12rpx;
					text-align: center;
				}

				.data-name {
					text-align: center;
				}

				/* 上标 */
				.dot,
				.point {
					color: #e43130;
					margin-left: 4rpx;
				}

				/* 点 */
				.point {
					display: inline-block;
					height: 10rpx;
				}
			}

			.data-item:not(:last-child)::after {
				position: absolute;
				right: 0;
				top: 50%;
				transform: translateY(-50%);
				content: '';
				display: block;
				width: 1rpx;
				height: 60%;
				background: #eee;
			}
		}

		/* 钱包数据 end */


		.list-cont {
			width: 100%;
			background: #f7f7f7;
			margin-top: 20rpx;


			.total-order {
				background: #fff;

				.order-tit {
					display: flex;
					justify-content: space-between;
					height: 80rpx;
					line-height: 80rpx;
					font-size: 30rpx;
					border-bottom: 1px solid #f7f7f7;
					padding: 0 30rpx;

					.checkmore {
						font-size: 24rpx;
						color: #80848f;
						display: flex;
						align-items: center;
					}
				}

				.procedure {
					display: flex;
					justify-content: space-around;
					align-items: center;
					font-size: 25rpx;
					height: 160rpx;

					.items {
						position: relative;
						display: flex;
						flex-direction: column;
						align-items: center;
						max-width: 20%;
						text-align: center;


						image {
							width: 50rpx;
							height: 50rpx;
							margin-bottom: 20rpx;
						}

						.num-badge {
							position: absolute;
							top: -15rpx;
							right: -12rpx;
							color: #fff;
							border-radius: 50rpx;
							background: #e43130;
							min-width: 30rpx;
							height: 32rpx;
							line-height: 32rpx;
							text-align: center;
							padding: 2rpx;
							display: block;
							box-shadow: 0px 0px 0px 2px #fff;
						}

						.after-sale-num-badge {
							right: 4rpx;
						}
					}
				}
			}

			.my-menu {
				/* width: 100%; */
				height: 100%;
				background-color: #fff;
				margin-top: 20rpx;

				.memu-item {
					display: flex;
					align-items: center;
					justify-content: space-between;
					height: 100rpx;
					border-bottom: 2rpx solid #f7f7f7;
					padding: 0 30rpx;

					text {
						font-size: 30rpx;
					}

					button {
						font-size: 30rpx;
						background: transparent;
						color: #000;
						line-height: 1em;
						padding: 0;
						margin: 0;
					}

					button::after {
						border: none !important;
					}

					image {
						width: 50rpx;
						height: 50rpx;
						margin-right: 20rpx;

					}

					.i-name {
						display: flex;
						align-items: center;
					}

					/* 箭头 */
					.arrowhead {
						width: 15rpx;
						height: 15rpx;
						border-top: 2rpx solid #999;
						border-right: 2rpx solid #999;
						transform: rotate(45deg);
						margin-left: 10rpx;
					}
				}

				.memu-item:nth-child(1) {
					border-top: 2rpx solid #f7f7f7;
				}

				.memu-item:last-child {
					border-bottom: none;
				}
			}

			.log-out {
				padding: 20rpx;
				text-align: center;
				margin-top: 20rpx;


				.log-out-n {
					font-size: 30rpx;
					margin: auto;
					width: 200rpx;
					padding: 20rpx;
					border-radius: 10rpx;
					background: #e43130;
					color: #ffffff;
				}
			}
		}

		/* end 订单状态 */

		/* end 列表项 */

		button.memu-btn.memu-item {
			background-color: #fff;
		}

		button.memu-btn.memu-item:after {
			border: 0;
		}
	}
</style>
